<template>
<div class="detail">
 <div  class="head">
 <router-link  to="/Home" class="back"></router-link>
 <div class="head_tittle">
   <ul>
     <li>商品</li>
     <li @click="tiao">详情</li>
     <li @click="zhuan">评价</li>
   </ul>
 </div>
 <div class="head_right">
   <span class="dot"></span>
 </div>
 </div>
 <div class="des">
   <div  class="des_show">
     <div class="contain">
       <img src="http://img2.wangjiu.com/product-image/20160419/25311344775310586">
     </div>
   </div>
   <div  class="des_art">
     <p  class="m_art">
     <label class="sref_art"><b>自营</b></label>
     <label  v-model="name">{{name}}</label></p>
     <p class="s_art">Chateau La Gaffeliere</p>
     <p  class="price" v-model="price">
       <span >￥<strong>{{price}}</strong></span>
     </p>
   </div>
</div>
 <div class="banner">
  <div  class="proper"  @click="tizh">
   <div class="slip"></div>
   <p>商品信息</p>
   </div>
  </div>

<div  class="banner2">
  <div class="proper2">
    <div  class="contain2">
       <p>选择数量</p>
      <div class="plus">
         <input type="button" name="" value="-" @click="cut">
         <input type="text"  class="box" v-model="num">
         <input type="button" name="" value="+" @click="add">
      </div>
    </div>
  </div>
 </div>
<div  class="banner3">
  <div  class="proper3">
        <div  class="slip"></div>
        <p>运货至
        <span>
           <b class="addTx">北京市 北京市 新城区</b>
           <b><label>有货</label><label>"由网酒网发货,并提供售后服务"</label></b>
        </span>
       </p>
     </div>
  </div>

<div  class="banner4">
    <div class="proper4">
       <div  class="slip"></div>
       <span class="all">查看全部</span>
       <p class="eval">商品评价(83)</p>
    </div>
</div>
<div  class="banner5">
   <p></p>
   <span @click="tiao">点击查看商品详情</span>
</div>
<div  class="down">
   <div  class="down_l1">
    <img src="../assets/home/image/d04.png">
    <p>收藏</p>
   </div>
   <div  class="down_l2">
   <img src="../assets/home/image/d10.png">
    <p>客服</p>
   </div>
   <div  class="down_l3" @click="jump">
   <img src="../assets/home/image/d11.png">
    <p>购物车</p>
    <div class="num"  v-model="count">{{count}}</div>
   </div>
    <div  class="down_l4"  @click="jia">
     加入购物车
   </div>
</div>
</div>
</template>

<script>
export default { 
  name: 'detail',
  url: "http://img2.wangjiu.com/product-image/20160419/25311344775310586",
 
  data () {
    return {
       msg: '<h1>这是新人领券页面</h1>',
       num:1,
       name:"【名庄】嘉芙丽庄园正牌干红葡萄酒",
       price:129,
       count:0,
    }
  },
  created:function(){
    $("footer").hide();
    this.name=localStorage.name;
    this.price=localStorage.price;
    fun();
    
  },
  
  

  methods:{
     add:function(){
       this.num++;
       this.count=this.num;
        
     },
     cut:function(){
       this.num--
       this.count=this.num;
       if (this.num<=1) {
         this.num=1
       }
     },
     jia:function(){
         this.count=this.num;
        if (this.count>=1) {
         $(".num").show()
      }else if (this.count<1) {
           $(".num").hide()
       }
     },
     fun:function(){
        if (this.count<1) {
          $(".num").hide()
         }
     },
     jump:function(){
       this.$router.push({name:'Cart'})
     },
     tiao:function(){
       this.$router.push({name:'content'})
     },
     zhuan:function(){
       this.$router.push({name:'pinjia'})
     },
     tizh:function(){
      this.$router.push({name:'xinxi'})
     }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

body{
     margin: 0px;
    padding: 0px;
    background: #f8f8f8;
    font-family: 'Microsoft YaHei';
    font-size: 0.375rem;
    color: #434343;
    max-width: 10rem;
    margin: 0 auto;
}
.detail{
  width: 100%;
  height: 100%;
}
.head{
     position: fixed;
    width: 100%;
    max-width: 100%;
    top: 0;
    background-color: #fff;
    z-index: 999;
}
.back{
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 44px;
}
.back:after{

    content: "";
    width: 10px;
    height: 10px;
    position: absolute;
    top: 18px;
    left: 21px;
    border-bottom: 1px solid #5d5d5d;
    border-right: 1px solid #5d5d5d;
    -webkit-transform: rotate(135deg);
    transform: rotate(135deg);
}
.head_tittle{
      height: 48px;
    line-height: 48px;
    margin: 0 60px;
}
.head_tittle ul{

    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}
.head_tittle ul li{

    -webkit-flex: 1;
    flex: 1;
    display: block;
    text-align: center;
}
.head_right{
    font-size: 14px;
    position: absolute;
    width: 40px;
    right: 0;
    top: 25px;
}
.dot{
     position: absolute;
    top: 50%;
    left: 10px;
   transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: #999;
    border-radius: 50%;
    line-height: 0px;
    font-size: 14px;
}
.dot:before{
    display: block;
    content: '';
    position: absolute;
    left:-10px;
    background: #999;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.dot:after{
    display: block;
    content: '';
    position: absolute;
    right: -10px;
    background: #999;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.des{
    width: 100%;
    height:100%;
    position: relative;
    top:48px; 
    background: #fff;
    margin-bottom: 0.344rem;
  
}
.contain{
   width: 100%;
   height: 10rem;
  
}
.contain img{
  width:100%;
  height:9rem;
}
.des_art{
  padding: 0.2rem 0.469rem 0.3rem;
}
.m_art{
   font-size: 0.4rem;
    color: #333;
    height: 0.6rem;
    line-height: 0.6rem;
} 
.sref{
    background: #ca0915;
    color: #fff;
    height: 0.4rem;
    line-height: 0.35rem;
    padding: 0 1px;
    border-radius: 3px;
    margin-right: 0.219rem;
    float: left;
    margin-top: 0.08rem;
}
.m_art label{
    display: inline-block;
    
    margin-bottom: 5px;
    font-weight: 700;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 7.9rem;
    display: inline-block;
}
.sref_art b{
    font-size: 0.3rem;
    height: 0.4rem;
    box-sizing: border-box;
    background-color: #ca0915;
    color: white;
}
.s_art{
      color: #999;
      font-size: 0.36rem;
      margin-top: 0.17rem;
}
.price{
    color: #ca0915;
    overflow: hidden;
    margin-top: 0.2rem;
}
.price span{
    font-weight: bold;
    font-size: 0.438rem;
    float: left;
}
.price  span strong{
      font-size: 0.625rem;
}
.banner{
    position: relative;
    background: #fff;
    margin-bottom: 0.344rem;
    top: 4.0rem;
    font-size: 0.375rem
   }
.banner:after{
    visibility: visible;
    content: '';
    position: absolute;
    width: 200%;
    left: 0;
    bottom: -1px;
    border-bottom: 1px solid #D9D9D9;
    border-top: 1px solid #D9D9D9;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
    border-radius: 1.1vw
}
.proper{
    padding: 0.46rem 0.469rem;
    overflow: hidden;
    position: relative;
}
.slip{
    position: absolute;
    right: 0.9rem;
    top: 50%;
    z-index: 1;
    display: block;
    width: 2.9vw;
    height: 3.9vw;
    border: 0.5vw solid #c7c7c7;
    border-top-color: transparent;
    border-right-color: transparent;
    -webkit-transform: rotate(-135deg) translate(50%,20%);
    transform: rotate(-135deg) translate(50%,20%);
 }
.banner p{
    color: #666666;
    float: left;
    padding-right: 5%;
}
.banner2{
    position: relative;
    top: 4.0rem;
    background: #fff;
    margin-bottom: 0.344rem;
    font-size: 0.375rem
}
.proper2{
    padding: 0.46rem 0.469rem;
    overflow: hidden;
    position: relative;
}
.contain2{
      overflow: hidden;
}
.contain2 p{
    color: #666666;
    float: left;
    padding-right: 5%;
}
.plus{
     width: 2.7rem;
    background-size: 100% 100%;
    position: absolute;
    right: 0.4rem;
    top: 50%;
   }
    

.plus input{
    float: left;
    width: 0.9rem;
    height: 0.9rem;
    background:#f8f8f8;;
    text-align: center;
    font-size: 0.375rem;
    box-sizing: border-box;
    padding-left: 2px;
}
.add{
    width: 0.9rem;
    border: 0;
   
    text-align: center;
    font-size: .375rem;
    box-sizing: border-box;
    padding-left: 2px;
}
.banner3{
      position: relative;
    top: 4.48rem;
    background: #fff;
    margin-bottom: 0.344rem;
    font-size: 0.375rem;width: 
}
.banner3:before{
    content: '';
    position: absolute;
    width: 200%;
    left: 0;
    top: 0;
    border-bottom: 1px solid #D9D9D9;
    border-top: 1px solid #D9D9D9;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
    border-radius: 1.1vw;
}
.proper3{
 padding: 5% 0.469rem;
}
.proper3 .slip{
  position: absolute;
  top: 0.8rem;
}
.proper3 p{
    color: #666666;
    float: left;
    padding-right: 5%;
}
.banner4{
    position: relative;
    top:4.9rem;

    background: #fff;
    margin-bottom: 0.344rem;
}
.banner4:before{
    content: '';
    position: absolute;
    width: 200%;
    left: 0;
    top: 0;
    border-bottom: 1px solid #D9D9D9;
    border-top: 1px solid #D9D9D9;
    -webkit-transform-origin: 0 0;
    transform-origin: 0 0;
    -webkit-transform: scale(0.5);
    transform: scale(0.5);
    border-radius: 1.1vw;
}
.proper4{
    padding: 0.46rem 0.469rem;
   
    position: relative;
    font-size: 0.375rem;
}
.slip{
  position: absolute;
  top: 0.8rem;
}
.all{
   float: right;
    margin-right: 6%;
    color: #b2b2b2;
    width: auto;
    position: absolute;
    right: 0.6rem;
    top: 80%;
    transform: translateY(-50%);
    font-size: 0.34rem;

}
.eval{
    color: #666666;
    float: left;
    padding-right: 5%;

}
 .banner5{
    padding: 20px 3%;
    position: relative;
    top: 5.2rem;
    height: 3.0rem;
    text-align: center;
    background-color: #f8f8f8;
 }
 .banner5 p{
    width: 80%;
    border-bottom: 1px #dfdfdf solid;
    position: absolute;
    top: 35%;
    left: 10%;
    z-index: 0;
 }
 .banner5 span{
    background-color: #f2f2f2;
    color: #666666;
    position: relative;
    padding: 0 3%;
    font-size: 0.34rem;
}
 .down{
    width: 100%;
    margin: 0 auto;
    position: fixed;
    bottom: 0;
    z-index: +999;
    height: 2.0rem;
    box-shadow: 0 0 10px rgba(0,0,0,.3);
    padding:3% 0;
    background-color: white;
 }
.down_l1{
    width: 20%;
   
   
    float: left;
    text-align: center;
   
    padding: 0 0;
}
.down_l1 img{
  width: 1rem;
  height:1rem;
}
.down_l1 p{
   font-size: 0.375rem;
   position: absolute;
   margin-left: 12px;
}
.down_l2{
    width: 20%;
   
   
    float: left;
    text-align: center;
   
    padding: 0 0;
}
.down_l2 img{
  width: 1rem;
  height:1rem;
}
.down_l2 p{
   font-size: 0.375rem;
   position: absolute;
    margin-left: 12px;
}
.down_l3{
    width: 20%;
   
    position:relative;
    float: left;
    text-align: center;
   
    padding: 0 0;
}
.down_l3 img{
  width: 1rem;
  height:1rem;
}
.down_l3 p{
   font-size: 0.375rem;
   margin-left: 10px;

}
.down_l4 {
  float: left;
  width: 40%;
  height: 2.0rem;
  background: #ca0915;
  color: white;
  text-align: center;
  line-height:2.0rem;
}
.num{
  width:16px;
  height: 16px;
  border: 1px solid red;
  border-radius: 50%;
  background-color: red;
  position: absolute;
  right: 12px;
  top: 2px;
  text-align: center;
  line-height: 16px;
  color: white;
  display: none;
}
</style>
